Skip to content

Preserve commit notifications when shutdown rejects submission - #3900

Open
mvanhorn wants to merge 1 commit into
ebean-orm:masterfrom
mvanhorn:fix/2565-ebean-commit-notification-shutdown
Open

mvanhorn wants to merge 1 commit into
ebean-orm:masterfrom
mvanhorn:fix/2565-ebean-commit-notification-shutdown

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

Commits during shutdown can lose post-commit notifications and log a notification failure.

When the background executor rejects submission, the exception reaches the outer logging handler and the notification task never runs.

What this changes

Catch RejectedExecutionException around submission and run the same notification task synchronously. Add a regression test that verifies the persist listener is notified when submission is rejected.

How it was tested

Mvn -B -ntp -pl ebean-core -am test-compile completed successfully; it compiled test sources without running tests. The tests in ebean-core/src/test/java/io/ebeaninternal/server/transaction/TransactionManagerNotifyOfCommitTest.java fail without the fix in the ebean TransactionManager change (checked by reverting the source changes).

Fixes #2565

Catch RejectedExecutionException around submission and run the same
notification task synchronously. Add a regression test that verifies the
persist listener is notified when submission is rejected.

Fixes ebean-orm#2565

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RejectionException while shutting down Ebean and NotifyOfCommit should be scheduled

1 participant